/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author hicham
 * this class represents the form.
 */
public class Form {
    public static int idLastCreated = 0;
    private int id;
    private String name;
    private String description;
    private String link; // URL or path on local disk
    private List<FormField> fields = new ArrayList<FormField>();

    public Form() {
        super();
        this.id = Commun.IncrementId(idLastCreated,1);
        idLastCreated++;
    }

    public Form(String name, String description, String link) {
        this();
        this.name = name;
        this.description = description;
        this.link = link;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public List<FormField> getFields() {
        return fields;
    }
    
    public void setFields(List<FormField> fields) {
        this.fields = fields;
    }
    
    public void addField(FormField field) {
        fields.add(field);
    }

}
